package main;

import java.util.Scanner;

import main.Main.command;

public class ConsoleInput {
	private command cmd;

	public ConsoleInput() {
		System.out
				.println("1 - getAll, 2 - add, 3 - edit, 4 - delete, 0 - exit");

	}

	public command getCmd() {
		Scanner in = new Scanner(System.in);
		String result = "";
		System.out.println("cmd: ");
		result = in.nextLine();

		switch (result) {
		case "0":
			cmd = command.exit;
			break;
		case "1":
			cmd = command.getAll;
			break;
		case "2":
			cmd = command.add;
			break;
		case "3":
			cmd = command.edit;
			break;
		case "4":
			cmd = command.delete;
			break;
		default:
			System.out.println("Please, choose a command from 0 to 4! ");
			return command.def;
		}
		return cmd;
	}
	
	public String getStringData(String value) {
		Scanner in = new Scanner(System.in);
		System.out.println("Enter "+value+": ");
		String result = in.nextLine();
		return result;
	}
	
	public int getIntData(String value) {
		Scanner in = new Scanner(System.in);
		System.out.println("Enter "+value+": ");
		int result = in.nextInt();
		return result;
	}
	

}
